// miniprogram/pages/class/class.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
 name:"",
 id:""
  },

 catagory:function(e){
 console.log(e)
 const id = 1
 const name ="文体艺术类"
 this.setData({
   id:id,
   name:name
 })
 wx.navigateTo({
   url: '../catagory/catagory?id='+id+'&name='+name,
 })
 },
  catagory2: function (e) {
    console.log(e)
    const id = 2
    const name = "创新创业类"
    this.setData({
      id: id,
      name: name
    })
    wx.navigateTo({
      url: '../catagory/catagory?id=' +id+'&name='+name,
    })
  },
  catagory3: function (e) {
    console.log(e)
    const id = 3
    const name = "社会实践类"
    this.setData({
      id: id,
      name: name
    })
    wx.navigateTo({
      url: '../catagory/catagory?id=' + id + '&name=' + name,
    })
  },
   catagory4: function (e) {
    console.log(e)
    const id = 4
    const name = "志愿服务类"
    this.setData({
      id: id,
      name: name
    })
    wx.navigateTo({
      url: '../catagory/catagory?id=' + id + '&name=' + name,
    })
  },
  catagory5: function (e) {
    console.log(e)
    const id = 5
    const name = "学生工作类"
    this.setData({
      id: id,
      name: name
    })
    wx.navigateTo({
      url: '../catagory/catagory?id=' + id + '&name=' + name,
    })
  },
  catagory6: function (e) {
    console.log(e)
    const id = 6
    const name = "全部活动"
    this.setData({
      id: id,
      name: name
    })
    wx.navigateTo({
      url: '../catagory/catagory?id=' + id + '&name=' + name,
    })
  },
  onLoad: function (options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },
  onSearch:function(e){
 console.log(e);
 const name=e.detail.value
 const id=7
    this.setData({
      name: name
    })
    wx.navigateTo({
      url: '../catagory/catagory?id=' + id + '&name=' + name,
    })
  },
  onCancel:function(){
    this.setData({
      'inputValue': ''
    })
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})